gdouble pos_x, pos_y;
gint pages_per_sheet;
gboolean ltr = TRUE;
+ GtkStateFlags state;
orientation = gtk_page_setup_get_orientation (priv->page_setup);
landscape =
number_up_layout = dialog_get_number_up_layout (dialog);
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
+ state = gtk_widget_get_state_flags (widget);
cairo_save (cr);
shadow_offset = 3;
- gtk_style_context_get_color (context, 0, &color);
+ gtk_style_context_get_color (context, state, &color);
cairo_set_source_rgba (cr, color.red, color.green, color.blue, 0.5);
cairo_rectangle (cr, shadow_offset + 1, shadow_offset + 1, w, h);
cairo_fill (cr);
- gtk_style_context_get_background_color (context, 0, &color);
+ gtk_style_context_get_background_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_rectangle (cr, 1, 1, w, h);
cairo_fill (cr);
cairo_set_line_width (cr, 1.0);
cairo_rectangle (cr, 0.5, 0.5, w + 1, h + 1);
- gtk_style_context_get_color (context, 0, &color);
+ gtk_style_context_get_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_stroke (cr);
if (page_setup != NULL)
{
+ PangoContext *pango_c = NULL;
+ PangoFontDescription *pango_f = NULL;
+ gint font_size = 12 * PANGO_SCALE;
+
pos_x += 1;
pos_y += 1;
cairo_restore (cr);
cairo_save (cr);
- layout = pango_cairo_create_layout (cr);
+ layout = pango_cairo_create_layout (cr);
font = pango_font_description_new ();
pango_font_description_set_family (font, "sans");
- PangoContext *pango_c = NULL;
- PangoFontDescription *pango_f = NULL;
- gint font_size = 12 * PANGO_SCALE;
-
pango_c = gtk_widget_get_pango_context (widget);
if (pango_c != NULL)
{
cairo_translate (cr, pos_x + w + shadow_offset + 2 * RULER_DISTANCE,
(height - layout_h / PANGO_SCALE) / 2);
+ gtk_style_context_get_color (context, state, &color);
+ gdk_cairo_set_source_rgba (cr, &color);
pango_cairo_show_layout (cr, layout);
cairo_restore (cr);
cairo_translate (cr, (width - layout_w / PANGO_SCALE) / 2,
pos_y + h + shadow_offset + 2 * RULER_DISTANCE);
+ gtk_style_context_get_color (context, state, &color);
+ gdk_cairo_set_source_rgba (cr, &color);
pango_cairo_show_layout (cr, layout);
g_object_unref (layout);
cairo_set_line_width (cr, 1);
+ gtk_style_context_get_color (context, state, &color);
+ gdk_cairo_set_source_rgba (cr, &color);
+
if (ltr)
{
cairo_move_to (cr, pos_x - RULER_DISTANCE, pos_y);